/**
 * Created by jiangtao on 2017/5/27.
 */

import {
    createStore,
    combineReducers,
    applyMiddleware,
    compose
} from 'redux';

import {
    syncHistoryWithStore,
} from 'react-router-redux'

import {
    routerReducer
} from 'react-router-redux';

import thunkMiddleware from 'redux-thunk';

import {
    createBrowserHistory ,
    createHashHistory
} from 'history';


import * as reducers from './../index';

let finalCreateStore = compose( applyMiddleware.apply( this , [ thunkMiddleware ]) )( createStore );

let store = finalCreateStore (
    combineReducers({
        ...reducers.default,
        routing: routerReducer
    })
);

export default store;

export const history = createHashHistory();

//打印state
// store.subscribe(() => console.log(store.getState()))




